import QtQuick
import QtQuick.Controls

Rectangle {
    //id: root
    width: 200
    height: 200

    states: [
        State {
            name: "active"
            when: cbox.checked
            PropertyChanges {
                target: rect
                border.color: "red"
            }
        }
    ]

    Rectangle {
        id: rect
        width: 180
        height: 100
        anchors.centerIn: parent
        border.color: "#333"
        radius: 8

        Text {
            text: "勾选CheckBox，边框变红"
            anchors.centerIn: parent
        }
    }

    CheckBox {
        id: cbox
        text: "激活状态"
        anchors.bottom: parent.bottom
    }
}

